<!--
  @author tanghongjun
  @since 2019年8月27日14:35:06
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<div class="layui-card-body" th:fragment="table" style="padding-top: 0;min-height: 600px">
    <div class="zmn-table-top"
         style="box-sizing:border-box; padding: 0 10px; width: 100%; height:40px;line-height:40px; border-bottom: 1px solid #e6e6e6;">
        <h4 style="float: left">
            <div class="layui-btn-group">
            <a href="#" th:if="${#authPermit.checkPermit('/service/item/batchWarrantyInfoDetail.action')}" th:onclick="batchAddWarrantyInfo([[${tariffId}]], [[${servCategId}]], [[${categOneId}]]);"  class="layui-btn layui-btn-sm" lay-submit="" lay-filter="zmn-form-submit">
                快速设置保修信息
            </a>
            </div>
            <div class="layui-btn-group">
                <a  href="#" th:if="${#authPermit.checkPermit('/service/group/copyGroup.action')}"
                    th:onclick="toCopyGroup([[${tariffId}]],[[${servCategId}]],[[${categOneId}]])"  class="layui-btn layui-btn-primary layui-btn-sm">复制分组</a>
                <a  href="#" th:if="${#authPermit.checkPermit('/service/group/detail.action')}"
                    th:onclick="toAddGroup([[${servCategId}]],[[${categOneId}]],[[${tariffId}]])"  class="layui-btn  layui-btn-primary layui-btn-sm">新增分组</a>
            </div>

        </h4>
    </div>

    <zmn th:each="faultGroupVO:${faultGroupVOList}">
        <div class="zmn-table-top"
             style="display:flex;justify-content:space-between;box-sizing:border-box; padding: 0 10px; width: 100%; height:40px;line-height:40px; background-color:#f2f2f2;border: 1px solid #e6e6e6;border-bottom: none;margin-top: 20px">
            <h4 th:title="${faultGroupVO.groupName+'(ID:'+faultGroupVO.groupId+',别名：'+faultGroupVO.groupAlias +')'}" style="flex: 1 1 auto;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><b><span th:text="${faultGroupVO.groupName+'(ID:'+faultGroupVO.groupId+',别名：'+faultGroupVO.groupAlias +')'}"></span></b></h4>
            <h4 style="white-space: nowrap;">
                <a th:if="${#authPermit.checkPermit('/service/item/detail.action')}" th:href="|/service/item/detail.action?groupId=${faultGroupVO.groupId}|" style="color: #00a0e9">新增项目&nbsp;&nbsp;</a>
                <a th:if="${#authPermit.checkPermit('/service/group/detail.action')}" href="#"  th:onclick="toEditGroup([[${faultGroupVO.groupId}]])" style="color: #00a0e9">修改分组</a>
                <a th:if="${#authPermit.checkPermit('/service/group/deleteGroup.action')&&faultGroupVO.groupCanDelete==2}" href="#"  th:onclick="toDeleteGroup([[${faultGroupVO.groupId}]])" style="color: #00a0e9">删除分组</a>
            </h4>
        </div>

        <table class="layui-table table-filter" th:id="${'zmn-table'+faultGroupVO.groupId}" th:lay-filter="${'zmn-table'+faultGroupVO.groupId}" style="margin-top: -1px;">
            <thead>
            <tr>
                <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
                <th lay-data="{field:'sort', width:80, unresize:true, sort:true, align:'center',fixed:'left',edit:'text'}" style="width: 80px;text-align: center">排序</th>
                <th lay-data="{field:'itemId', minWidth:80, unresize:true, align:'center',fixed:'left'}" style="width: 100px;text-align: center">项目ID</th>
                <th lay-data="{field:'itemName', minWidth:120, unresize:false, align:'center',fixed:'left'}" style="width: 120px;">项目名称</th>
                <th lay-data="{field:'unit', minWidth:60, unresize:false, align:'center'}" style="text-align: right">单位</th>
                <th lay-data="{field:'categName', minWidth:100, unresize:false, align:'center'}" style="text-align: right">项目类型名称</th>
                <th lay-data="{field:'priceStandard', minWidth:80,unresize:false, align:'center'}" style="text-align: center">一口价</th>
                <th lay-data="{field:'priceSplit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">区分明细</th>
                <th lay-data="{field:'priceSplitType', minWidth:80, unresize:false, align:'center'}" style="text-align: center">明细类型</th>
                <th lay-data="{field:'trafficFee', minWidth:90, unresize:false, align:'center',hide:true}" >交通费</th>
                <th lay-data="{field:'hourFee', minWidth:90, unresize:false, align:'center',hide:true}" >工时费</th>
                <th lay-data="{field:'serviceRatio', minWidth:90, unresize:false, align:'center',hide:true}">技术服务费</th>
                <th lay-data="{field:'partRatio', minWidth:90, unresize:false, align:'center',hide:true}">配件包干费</th>

                <th lay-data="{field:'materialFee', minWidth:90, unresize:false, align:'center',hide:true}">材料费</th>
                <th lay-data="{field:'factoryFee', minWidth:90, unresize:false, align:'center',hide:true}"> 工艺费</th>
                <th lay-data="{field:'numberStep', minWidth:90, unresize:false, align:'center',hide:true}">阶梯值</th>
                <th lay-data="{field:'numberStepDown', minWidth:90, unresize:false, align:'center',hide:true}">阶梯降幅</th>
                <th lay-data="{field:'baseDiscount', minWidth:90, unresize:false, align:'center',hide:true}">底折</th>

                <th lay-data="{field:'countLimit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">最大数量</th>
                <th lay-data="{field:'general', minWidth:80, unresize:false, align:'center'}" style="text-align: center">默认项目</th>
                <!--<th lay-data="{field:'mutexMode', minWidth:80, unresize:false, align:'center'}" style="text-align: center">互斥性</th>-->
                <!--<th lay-data="{field:'cityLimit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">城市系数</th>-->
                <!--<th lay-data="{field:'brandLimit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">品牌系数</th>-->
                <!--<th lay-data="{field:'editEnable', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">APP编辑</th>-->
                <!--<th lay-data="{field:'show', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">APP显示</th>-->
                <!--<th lay-data="{field:'takePicture', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">工程师拍照</th>-->
                <!--<th lay-data="{field:'manualPrice', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">修改价格</th>-->
                <!--<th lay-data="{field:'desc', minWidth:80, unresize:false, align:'center'}" style="text-align: center">项目说明</th>-->
<!--                <th lay-data="{field:'afterService', minWidth:80, unresize:false, align:'center'}" style="text-align: center">是否保修</th>-->
<!--                <th lay-data="{field:'afterServiceDesc',minWidth:80,unresize:false, align:'center'}">保修范围</th>-->
<!--                <th lay-data="{field:'afterServiceDay', minWidth:80, unresize:false, align:'center'}" style="text-align: center">保修天数</th>-->
                <th lay-data="{field:'status', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">状态</th>
                <th lay-data="{field:'操作',minWidth:140, unresize:false, align:'center'}" style="text-align: center">操作</th>
            </tr>
            </thead>

            <tbody>
            <tr th:each="item:${faultGroupVO.items}">
                <td></td>
                <td th:text="${item.sort}" style="text-align: center">sort</td>
                <td th:text="${item.itemId}" style="text-align: center">itemId</td>
                <td th:text="${item.itemName}" class="layui-gray">itemName</td>
                <td th:text="${item.unit}" style="text-align: right" class="layui-gray">unit</td>
                <td th:text="${item.categName}" style="text-align: right" class="layui-gray">categId</td>
                <td th:text="${item.priceStandard==2?'是':'否'}" style="text-align: center" class="layui-gray">priceStandard</td>
                <td th:text="${item.priceSplit==null?'-':(item.priceSplit==2?'区分':'不区分')}" style="text-align: center" class="layui-gray">priceSplit</td>
                <td th:text="${item.priceSplitType==null?'-':(item.priceSplitType==2?'明细二(阶梯价)':'明细一')}" style="text-align: center" class="show priceSplitType">priceSplitType</td>

                <td th:text="${item.trafficFeeYuan==''?'-':#numbers.formatDecimal(item.trafficFeeYuan,1,'COMMA',2,'POINT')}" class="show trafficFeeYuan">trafficFeeYuan</td>
                <td th:text="${item.hourFeeYuan==''?'-':#numbers.formatDecimal(item.hourFeeYuan,1,'COMMA',2,'POINT')}" class="show hourFeeYuan">hourFeeYuan</td>
                <td th:text="${item.serviceRatio==null?'-':item.serviceRatio}" class="show serviceRatio">serviceRatio</td>
                <td th:text="${item.partRatio==null?'-':item.partRatio+'%'}" class="show partRatio">partRatio</td>
                <td th:text="${item.materialFee==null?'-':item.materialFee+'%'}" class="show materialFee">materialFee</td>
                <td th:text="${item.materialFee==null?'-':(100-item.materialFee)+'%'}" class="show factoryFee">factoryFee</td>
                <td th:text="${item.numberStep==null?'-':item.numberStep}" class="show numberStep">numberStep</td>
                <td th:text="${item.numberStepDown==null?'-':item.numberStepDown+'%'}" class="show numberStepDown">numberStepDown</td>
                <td th:text="${item.baseDiscount==null?'-':item.baseDiscount+'%'}"class="show baseDiscount">baseDiscount</td>

                <td th:text="${item.countLimit==null?'-':item.countLimit}" style="text-align: center">countLimit</td>
                <td th:text="${item.general==2?'默认':'非默认'}" style="text-align: center">general</td>
                <!--<td th:text="${T(com.zmn.plat.manager.dictionary.ProductDict).getMutex(item.mutexMode)}" style="text-align: center">mutexMode</td>-->
                <!--<td th:text="${item.cityLimit==2?'影响':'不影响'}" style="text-align: center">cityLimit</td>-->
                <!--<td th:text="${item.brandLimit==2?'影响':'不影响'}" style="text-align: center">brandLimit</td>-->
                <!--<td th:text="${item.editEnable==2?'编辑':'不编辑'}" style="text-align: center">editEnable</td>-->
                <!--<td th:text="${item.show==2?'显示':'不显示'}" style="text-align: center">show</td>-->
                <!--<td th:text="${item.takePicture==2?'拍照':'不拍照'}" style="text-align: center">takePicture</td>-->
                <!--<td th:text="${item.manualPrice==2?'修改':'不修改'}" style="text-align: center">manualPrice</td>-->
                <!--<td th:text="${item.desc}" style="text-align: center">desc</td>-->
<!--                <td th:switch="${item.afterService}">-->
<!--                    <div th:case="1">部分保修</div>-->
<!--                    <div th:case="2">整机保修</div>-->
<!--                    <div th:case="3">不保修</div>-->
<!--                </td>-->
<!--                <td th:text="${item.afterServiceDesc}" style="text-align: center">afterServiceDesc</td>-->
<!--                <td th:text="${item.afterServiceDay==null?'':item.afterServiceDay+'天'}" style="text-align: center">afterServiceDay</td>-->
                <td th:switch="${item.status}">
                    <div th:case="1">停用</div>
                    <div th:case="2">启用</div>
                </td>
                <td style="text-align: center">
                    <!--<th:block th:switch="${#authPermit.checkPermit('/service/item/detail.action')}">-->
                        <!--<a th:case="true" th:lay-href="|/service/item/detail.action?itemId=${item.itemId}|" lay-text="修改" style="color: #00a0e9;text-align: center">修改</a>-->
                        <!--<a th:case="false" style="text-align: center">&#45;&#45;</a>-->
                    <!--</th:block>-->
                    <!--<zmn th:if="${#authPermit.checkPermit('/service/item/warrantyInfoList.action')}">-->
                        <!--<a th:lay-href="|/service/item/warrantyInfoList.action?servCategId=${servCategId}&categOneId=${categOneId}&groupId=${item.groupId}&itemId=${item.itemId}|" lay-text="保修信息" style="color: #00a0e9;text-align: center">保修信息</a>-->
                    <!--</zmn>-->
                    <!--<zmn th:if="${item.status==1}">-->
                        <!--<th:block th:switch="${#authPermit.checkPermit('/service/item/deleteItem.action')}">-->
                            <!--<a th:case="true" href="javascript:void(0)" th:onclick="deleteItem([[${item.itemId}]],[[${item.itemName}]]);" style="color: #00a0e9;text-align: center">删除</a>-->
                            <!--<a th:case="false" style="text-align: center">&#45;&#45;</a>-->
                        <!--</th:block>-->
                    <!--</zmn>-->
                    <button  class="layui-btn layui-btn-sm operator" th:attr="param=${item.groupId+','+item.itemId+','+item.status+','+item.itemName+','+item.priceSplit}">
                        操作
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </zmn>
</div>

